<?php

namespace Xin\Plugin\Exceptions;

use Throwable;
use Xin\Plugin\Contracts\PluginNotFoundException as PluginNotFoundExceptionContract;

class PluginNotFoundException extends \Exception implements PluginNotFoundExceptionContract
{
    /**
     * @var string
     */
    protected $plugin;

    /**
     * PluginNotFoundException constructor.
     *
     * @param string $plugin
     * @param \Throwable|null $previous
     */
    public function __construct($plugin, Throwable $previous = null)
    {
        parent::__construct("plugin {$plugin} not found!", 404, $previous);
    }

    /**
     * @return string
     */
    public function getPlugin()
    {
        return $this->plugin;
    }

}
